UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OWEM31nRoBLmZksa0vg8fjbvenzdOVMAFgMXWjRJaKY='
WHERE
key_id = 'f29af5b6551bd20d0a176db518e63545d07f90126607d00ef9507f2c9ddff3f0'
AND (
token = 'OWEM31nRoBLmZksa0vg8fjbvenzdOVMAFgMXWjRJaKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)