UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sodpNY1MN571eWe0a00zfAZ6RRAW0SokQpp6BDb2maE='
WHERE
key_id = 'c8cbebd2c3a14fc2ab4700ee70e3a82b0229b78cebdd7818cb43f65d85708fbe'
AND (
token = 'sodpNY1MN571eWe0a00zfAZ6RRAW0SokQpp6BDb2maE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)