UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ervcw6K/flXnW7IxZScI6KvTCXBaEbLkO27E9bujJtE='
WHERE
key_id = '30cbc90db4c169f04b849e27bc87ca5cf60698918c3ff83bec3617cad001f972'
AND (
token = 'Ervcw6K/flXnW7IxZScI6KvTCXBaEbLkO27E9bujJtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)