UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jBV6bLlSToirDayivmjz4vNVKbBLXlDnkObsC/7gy6c=' 
WHERE 
  key_id = '700b85df78c46f5d1c934168667b46eea1f2b4c10518cca8dbbe0242c3c2cdda' 
  AND (
    token = 'jBV6bLlSToirDayivmjz4vNVKbBLXlDnkObsC/7gy6c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024