UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'btzqwg9Hq7HpkbxLTUV3NU13xe2p5rlcQ3Dw2D9eyFI=' 
WHERE 
  key_id = '4e2d35ad3ca77b211d63025230912a93a952865b6e36a633412139edda59fef1' 
  AND (
    token = 'btzqwg9Hq7HpkbxLTUV3NU13xe2p5rlcQ3Dw2D9eyFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038