UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vRaW5BIfKZB77r0VRkr/VPUhDIykq4ouZHm3XRyQDFk=' 
WHERE 
  key_id = 'a95d773bcb84d6140e616ecede2b54987581f90c55ffdaed27361d4a01ac243b' 
  AND (
    token = 'vRaW5BIfKZB77r0VRkr/VPUhDIykq4ouZHm3XRyQDFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032