UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QrzzRMeJO5+obKRy3FXFsqOuQ8G733ml3k54JSOi8DY='
WHERE
key_id = '44d96ac58a53c98f4f52dce656f5dd424f28cd7220f51f03cfa7ec56e5982870'
AND (
token = 'QrzzRMeJO5+obKRy3FXFsqOuQ8G733ml3k54JSOi8DY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)