UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fto7i68rVcFgcquS3+Tk4XCx2W8GtkDF2Tj1LXjNAZc='
WHERE
key_id = 'e3a47d88e4d71cd01dbb4fdd8fa86ff694cc7ca33aacfea01f614861c44229b7'
AND (
token = 'Fto7i68rVcFgcquS3+Tk4XCx2W8GtkDF2Tj1LXjNAZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)