UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SyYVh7kzAaJlvlht5xm6/6TnnJoHV1w8iMOu1IKCJWc='
WHERE
key_id = '6b507772942cc068a939cfb1bc83be0437786cc650088a82daa18793920f1fae'
AND (
token = 'SyYVh7kzAaJlvlht5xm6/6TnnJoHV1w8iMOu1IKCJWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)