UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1kjvGFAN9BcEhKVOmqAse3EdHod9iSxxrujf5ShO+YI='
WHERE
key_id = '7a8adfedd03a6245bc774dc38de435befe4ad36d3a9cd6ecdb9a175547e93198'
AND (
token = '1kjvGFAN9BcEhKVOmqAse3EdHod9iSxxrujf5ShO+YI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)