UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UzVFpkxlH5hHzJCC7VpuupdizZPAbEul2PmmzYK8mVA=' 
WHERE 
  key_id = '3708598eb2d42592cda3a791e14ee4ddc3ec8918e8edd67c76e6708b5311700f' 
  AND (
    token = 'UzVFpkxlH5hHzJCC7VpuupdizZPAbEul2PmmzYK8mVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026