UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QtLt95spioRFishGTqZynfyOFGEfWc4X4Qw/0EUSifg='
WHERE
key_id = 'ab49132891b4009e5d1992018c4511e98114905365127887c2de5e95acf49962'
AND (
token = 'QtLt95spioRFishGTqZynfyOFGEfWc4X4Qw/0EUSifg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)