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