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

Query time 0.00034