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