UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FVXc6fTwqhCvu+8NEIyeae4/bVOFStqAD1dQtTMI2L8='
WHERE
key_id = '66bd38d4424a779161cc9360185356f568567ecf38ea97194052302927532a69'
AND (
token = 'FVXc6fTwqhCvu+8NEIyeae4/bVOFStqAD1dQtTMI2L8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)