UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HL1GYaplINVFrQIUdLf9dL7shV4aDqIUno3lpixYuVw='
WHERE
key_id = '1cfc7032c182166030fb526f0a19d287bbf49ea654b8337fd8a417a40c5f737c'
AND (
token = 'HL1GYaplINVFrQIUdLf9dL7shV4aDqIUno3lpixYuVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)