UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kA3vnktb4C5560+95+t0aIlKlio3oActvAro8xluMfQ='
WHERE
key_id = 'e2980d68f304e9aa09a74bb08448ff8edf5b31d24b8d280a958e19a6302c2c61'
AND (
token = 'kA3vnktb4C5560+95+t0aIlKlio3oActvAro8xluMfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)