UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/O48KS54J0wunqPZtk1FdYkdD1v588ZVPh/3cCJH1yQ='
WHERE
key_id = 'efc921aa8b7ed0af7081779c79e028253d6775a3dd2e4bdd3772d7f395935b3a'
AND (
token = '/O48KS54J0wunqPZtk1FdYkdD1v588ZVPh/3cCJH1yQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)