UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L/XCH7yz3Myz4AedRChWW1c04nhQ5Mk6mEo93Rxe7P0='
WHERE
key_id = '282f667d4ad4bad7dcb5e765c140aa0fd558f3268ac35de93dcd1c3e3c5bb96a'
AND (
token = 'L/XCH7yz3Myz4AedRChWW1c04nhQ5Mk6mEo93Rxe7P0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)