UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6S9ZpzkrszFyxKiauNtpKDwaiX9PpU5awaw0qzez62U='
WHERE
key_id = 'e9fcd556836785bacf4d741e6a62d645053122a3e09088640e4a982fdcd7cf4b'
AND (
token = '6S9ZpzkrszFyxKiauNtpKDwaiX9PpU5awaw0qzez62U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)