UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r4Ifjabj8qIdLmXAA4PPo/cBOio50dssCgLf4Qu8Ves='
WHERE
key_id = '38fa34e5e00c62b6b9dd5a284fe3d6d9818df40af46461e09833ad663a70f0f0'
AND (
token = 'r4Ifjabj8qIdLmXAA4PPo/cBOio50dssCgLf4Qu8Ves='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)