UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's6f1UGKwt26suCUU6uL5N53nT6q+rYQja53GK7Neqik='
WHERE
key_id = '341b88a0c7c7e2646c3f9b6ecd6cbbfd4e79ea6a2681d5e57c673c6b0c6bfd3f'
AND (
token = 's6f1UGKwt26suCUU6uL5N53nT6q+rYQja53GK7Neqik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)