UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pPfKZzmABr69r53GCo/6lJBG1/3GHfXpq1+A4j4N9Qc='
WHERE
key_id = '5b96c6a51f332bb1a2ffe06df110b3ddcc2faabdf9412c6eb312bddd01e05225'
AND (
token = 'pPfKZzmABr69r53GCo/6lJBG1/3GHfXpq1+A4j4N9Qc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)