UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5M0iy9KRZ0zO3GcbomeAisrxtdRoBKBTEJ+OGtdv1Uw=' 
WHERE 
  key_id = '4421708c2ee788406da73d9d52ff1b8570950e70fa19d94766e68fe52743c624' 
  AND (
    token = '5M0iy9KRZ0zO3GcbomeAisrxtdRoBKBTEJ+OGtdv1Uw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043