UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iwlAQn1egjV7oHUl55MnlFcicQvtMRlHafDTGmIkGLc='
WHERE
key_id = '3c0803e8ffdaf8ac8c9cb40552cce01ac364fde887e4f5ed02ce02dec732fa8c'
AND (
token = 'iwlAQn1egjV7oHUl55MnlFcicQvtMRlHafDTGmIkGLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)