UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FevsXCsLzyIpWY32tedUSOrV8ttGx0QME5iqiiJAIV4='
WHERE
key_id = '561b0fb46a7fd306d74258e2e8a090d53db800b2de25c882e61d6dc7ed263da7'
AND (
token = 'FevsXCsLzyIpWY32tedUSOrV8ttGx0QME5iqiiJAIV4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)