UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r2DdwpK/Ge/uQNzilr59SY7kbBze0CzTvGMDGtUEh0w='
WHERE
key_id = '38f0dbcf7a014a8975cf20aadfd8fcfe82fe9d0a2f70b7225f28eb1065d1bb3a'
AND (
token = 'r2DdwpK/Ge/uQNzilr59SY7kbBze0CzTvGMDGtUEh0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)