UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1U69ekpIdFE31N/hY/EZtd/0UzZ8mVavQBkerOJlxpA=' 
WHERE 
  key_id = '1e3d962a487b1f9d4c7bd6612f49cb55ac27e0dd3a198a9469d4af182237b81d' 
  AND (
    token = '1U69ekpIdFE31N/hY/EZtd/0UzZ8mVavQBkerOJlxpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042