UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gC/iV4yqHf6gj++tjNppgcM2nLShETucG3nmVrGj6qs='
WHERE
key_id = 'eb073993b3d504c429677607e0e4704a6f129eb7a4a099ff716b8c407792d19d'
AND (
token = 'gC/iV4yqHf6gj++tjNppgcM2nLShETucG3nmVrGj6qs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)